<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>跨浏览器js实现复制剪切板功能</title>
</head>
<body>
  <textarea id="content" rows="10" cols="60">这里是需要复制的内容</textarea>
  <input id="copy" type="button" data-clipboard-target="content" value="复制">
<script src="ZeroClipboard.min.js"></script>
<script type="text/javascript">
ZeroClipboard.config( { swfPath: '../swf/ZeroClipboard.swf' } );
// 将【复制】按钮充当复制数据的元素载体
var clip = new ZeroClipboard( document.getElementById("copy") );
</script>
</body>
</html>